-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA] [Workspace Feeds] Create new Card List page #44469
[No QA] [Workspace Feeds] Create new Card List page #44469
Conversation
# Conflicts: # src/libs/API/parameters/index.ts # src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx # src/libs/actions/Policy/Policy.ts # src/pages/workspace/WorkspaceInitialPage.tsx
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Can you share a quick screen recording when you get a chance as well? Thanks! |
@VickyStash , I would be reviewing this PR instead of @DylanDylann , do let me know when you implement the latest suggestions from @shawnborton , I will start my review after the changes thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments, will review the page UI once the suggestions from shawn are implemented
@@ -0,0 +1,6 @@ | |||
type OpenPolicyExpensifyCardsPageParams = { | |||
policyID: string; | |||
authToken: string | null | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think we should have a auth token
ever as undefined
, null case is okay but i highly doubt that we should keep it's type as undefined, what's your take on this @VickyStash ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the return type of the getAuthToken function
App/src/libs/Network/NetworkStore.ts
Lines 96 to 98 in 1d607ac
function getAuthToken(): string | null | undefined { | |
return authToken; | |
} |
But I agree that undefined
can be removed, but I'm not sure that I should do it in this PR.
@@ -0,0 +1,6 @@ | |||
type RequestExpensifyCardLimitIncreaseParams = { | |||
authToken: string | null | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as ^
// const [cardsList] = useOnyx(`${ONYXKEYS.COLLECTION.EXPENSIFY_CARDS_LIST}${policyID}_Expensify Card`); | ||
const cardsList = mockedCards; | ||
|
||
const fetchExpensifyCards = useCallback(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't useMemo
more appropriate here? , well there must be a reason for useCallback
can you explain please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep it aligned with other places in the code:
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 59 to 61 in 1d607ac
const fetchTags = useCallback(() => { | |
Tag.openPolicyTagsPage(policyID); | |
}, [policyID]); |
App/src/pages/workspace/WorkspaceInitialPage.tsx
Lines 136 to 138 in 1d607ac
const fetchPolicyData = useCallback(() => { | |
Policy.openPolicyInitialPage(route.params.policyID); | |
}, [route.params.policyID]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the latest changes, Look good to merge !
src/ONYXKEYS.ts
Outdated
/** Expensify cards list */ | ||
EXPENSIFY_CARDS_LIST: 'card_', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** Expensify cards list */ | |
EXPENSIFY_CARDS_LIST: 'card_', | |
/** | |
* Stores the card list for a given fundID and feed in the format: card_<fundID>_<bankName> | |
* So for example: card_12345_ExpensifyCard | |
*/ | |
EXPENSIFY_CARDS_LIST: 'card_', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just have a question on removing the ExpensifyCard.ts in favor of Card.ts
https://github.com/Expensify/App/pull/44469/files#r1662157151
@MariaHCD yes in a sec, totally haven't thought about it 😅 |
src/ONYXKEYS.ts
Outdated
|
||
/** | ||
* Stores the card list for a given fundID and feed in the format: card_<fundID>_<bankName> | ||
* So for example: card_12345_ExpensifyCard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, apparently its with a space
* So for example: card_12345_ExpensifyCard | |
* So for example: card_12345_Expensify Card |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the card name right? <bankName>
would be different here 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allgandalf it's not the name of the card, it's the name of the card feed which is referred to as bankName internally. For this project, the feed / bankName is Expensify Card
- we will have more feeds introduced in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, now that makes more sense to me 👍
src/ONYXKEYS.ts
Outdated
* Stores the card list for a given fundID and feed in the format: card_<fundID>_<bankName> | ||
* So for example: card_12345_ExpensifyCard | ||
*/ | ||
EXPENSIFY_CARDS_LIST: 'card_', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what is the best const name here so it doe snot intervene with the cardsList key
I dont think we should use Expensify_cards list as this will be reused for other feeds that are not necessarily Expensify cards cc @MariaHCD
I feel like Workspace might be ok, but also it might be be that clear with the domain feeds that are not strictly tied to a workspace
EXPENSIFY_CARDS_LIST: 'card_', | |
WORKSPACE_CARDS_LIST: 'card_', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. I'm thinking EXPENISFY_CARDS_LIST
still makes the most sense.
Alternatively, we can go with WORKSPACE_CARDS_LIST
and then for domain feeds it could a new const called DOMAIN_CARDS_LIST
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But having just one makes the most sense, I think so I'm still fine with EXPENISFY_CARDS_LIST
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, looks like we're going with WORKSPACE_CARDS_LIST
. I'm fine with that since it is more clear. We can change it down the line without much difficulty if we find it's not suitable for domain feeds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koko57 couple comments
src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/expensifyCard/WorkspaceExpensifyCardPage.tsx
Outdated
Show resolved
Hide resolved
src/types/onyx/ExpensifyCard.ts
Outdated
import type PersonalDetails from './PersonalDetails'; | ||
|
||
/** Model of an Expensify card */ | ||
type ExpensifyCard = OnyxCommon.OnyxValueWithOfflineFeedback<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, I assume we could reuse the same model
@mountiny addressed |
are all the comments addressed @koko57 ? I will test once again on all platforms just to be sure |
@allgandalf yep, all addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial checklist is here, Tested again on all platforms after latest changes. Tests well on all platforms:
Screenshots/Videos
Android: Native
Screen.Recording.2024-07-02.at.6.15.28.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for addressing the feedback
Seems like design also liked the changes so I am going to go ahead and merge this |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.4-0 🚀
|
🚀 Cherry-picked to staging by https://github.com/tgolen in version: 9.0.4-5 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
Details
[Workspace Feeds] Create new Card List page
Fixed Issues
$ #44310
PROPOSAL: N/A
Tests
Pre-steps:
Add a new menu item to a workspace menu to simplify testing.
Insert this part of code into WorkspaceInitialPage screen.
You should see
Expensify Card
option in the workspace menu now.Test steps:
NOTE: the data is mocked for now, API endpoints are in progress.
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop